# segment the events_data
import json
with open("./output/ioda_events_data.json", "r") as f:
    events_data = json.load(f)

length = len(events_data["data"])//5 + 1 

for i in range(5):
    if i==4:
        data = events_data["data"][i * length:]
    else:
        data = events_data["data"][i * length: (i+1) * length]
    print(len(data))
    with open(f"./output/ioda_events_data_seg{i}.json", "w") as f:
        json.dump(data,f,ensure_ascii=False)
